package Text17;

import java.util.*;
public class Main {
    static int N = 1000010,cnt;
    static int[] pr=  new int[N];
    static boolean[] st = new boolean[N];
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        find(n);
    }
    private static void find(int n) {
        int cnt = 0;
        for (int i = 2; i <= n; i++) {
            if (!st[i]) {
                pr[cnt++]=i;
                }
            for (int j = 0; pr[j] <=n/i ; j++) {
                st[pr[j]*i]=true;
                if(i%pr[j]==0){
                    break;
                }
            }
            }
        System.out.println(cnt);
        }
}
